<template>
	<view class="zhaoshangTop">
		<tt-bar leftIcon="icon-back" title="我的招商" titleAlign="left"></tt-bar>
		<view class="zhaoshangList"  v-for="(item,index) in zhaoshangList" :key="index">
			<text class="shopping">{{item.name}}</text>		
		</view>
		
		<!-- 当请求的来的数据为空时显示 -->
		
		<emptyBox v-if="showbtn"></emptyBox>
	</view>
</template>

<script>
	import {
		mapState
	} from "vuex";
	export default {
		computed: {
			...mapState({
				userInfo: state => state.user.userInfo
			})
		},
		data() {
			return {
				zhaoshangList:[],
				showbtn:false
			}
		},
		methods: {
			// 获取招商列表
			getzhaoshangList() {
				this.$store.dispatch('apiJoinTeamb', { userId:this.userInfo.userId }).then(res => {
					
					if(res.data.data[0]){
						this.zhaoshangList = res.data.data
						
					}else{
						this.showbtn=true
					}
					
					
					
				});
			}
		},
		onLoad() {
			this.getzhaoshangList()
		}
	}
</script>

<style lang="less">
	.zhaoshangList {
		width: 100%;
		height: 80rpx;
		padding: 10rpx 20rpx 0 20rpx;
		border-bottom: 1px solid #ccc;
	
		.shopping {
			font-size: 30rpx;
			color: #4e4e4e;
			
		}
	
		// .hexiaoTime {
		// 	font-size: 20rpx;
		// 	display: flex;
		// 	justify-content: space-between;
		// 	color: #999;
		// }
	}

</style>
